package com.yzh.wrapper.teacher;

public class TestWrapper2 {
    int n; //默认值是0
    Integer in; //默认值是null

    public static void main(String[] args) {
        //1.自动装箱和自动拆箱
        //Integer in = new Integer(80);//手动装箱

        //int i = in.intValue();//手动拆箱

//        Integer in = 5; //自动装箱
//        int i = in; //自动拆箱


        //System.out.println(in +"  "+i);

        //2.理解Integer的==和equals的区别
//        Integer in1 = new Integer(280);
//        Integer in2 = new Integer(280);
//        System.out.println(in1==in2);//false
//        System.out.println(in1.equals(in2));//true

        Integer in1 = -128;
        //Integer in1 = new Integer(-127); 错
        //Integer in1 = Integer.valueOf(-127);//对  自动装箱
        Integer in2 = -128;
        System.out.println(in1 == in2);//true!!!!!!  -128---127
        System.out.println(in1.equals(in2));//true

        Integer in3 = 1234;
        Integer in4 = 1234;
        System.out.println(in3== in4);//false
        System.out.println(in3.equals(in4));//true


        int a = 444;
        Object obj = a;


    }
}
